# 加载相关包
library(openxlsx)
library(geepack)


# 读取数据
data_test = read.xlsx("./data917.xlsx", 3)
data_anal = data_test[, c(1, 9:13, 14:25, 27, 29:33)]
varsx = colnames(data_test)[c(14:25, 27)]
varsy = colnames(data_test)[c(9:13)]
varsc = colnames(data_test)[c(29:33)]

# 转换变量类型：因变量为数值、自变量为因子
data_anal[varsy] = lapply(data_anal[varsy], as.numeric)
data_anal[varsx] = lapply(data_anal[varsx], as.factor)
gee_run(data_anal, varsx = varsx, varsy = varsy, varsc = varsc[-5], file = "output1234.xlsx")
gee_run(data_anal, varsx = varsx, varsy = varsy, varsc = varsc[-2], file = "output1345.xlsx")